home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Washington_1988 / DevCon88.3 / Printer / src / init.asm
Encoding:
Assembly Source File  |  1992-08-27  |  3.6 KB  |  179 lines

  1.     TTL    '$Header: init.asm,v 1.1 88/04/14 12:03:14 daveb Exp $'
  2. **********************************************************************
  3. *                                     *
  4. *   Copyright 1985, Commodore-Amiga Inc.   All rights reserved.         *
  5. *   No part of this program may be reproduced, transmitted,         *
  6. *   transcribed, stored in retrieval system, or translated into         *
  7. *   any language or computer language, in any form or by any         *
  8. *   means, electronic, mechanical, magnetic, optical, chemical,         *
  9. *   manual or otherwise, without the prior written permission of     *
  10. *   Commodore-Amiga Incorporated, 983 University Ave. Building #D,   *
  11. *   Los Gatos, California, 95030                     *
  12. *                                     *
  13. **********************************************************************
  14. *
  15. *    printer device functions
  16. *
  17. *   Source Control
  18. *   --------------
  19. *   $Header: init.asm,v 1.1 88/04/14 12:03:14 daveb Exp $
  20. *
  21. *   $Locker:  $
  22. *
  23. *   $Log:    init.asm,v $
  24. *   Revision 1.1  88/04/14  12:03:14  daveb
  25. *   V1.3 Gamma 11 release
  26. *   
  27. *   Revision 1.0  87/08/20  14:10:17  daveb
  28. *   added to rcs
  29. *   
  30. *   Revision 1.1  85/10/09  19:27:20  kodiak
  31. *   remove _stdout variable
  32. *   
  33. *   Revision 1.0  85/10/09  19:23:23  kodiak
  34. *   added to rcs for updating in version 1
  35. *   
  36. *   Revision 25.0  85/06/16  01:01:22  kodiak
  37. *   added to rcs
  38. *   
  39. *
  40. **********************************************************************
  41.  
  42.     SECTION        printer
  43.  
  44. *------ Included Files -----------------------------------------------
  45.  
  46.     INCLUDE        "exec/types.i"
  47.     INCLUDE        "exec/nodes.i"
  48.     INCLUDE        "exec/lists.i"
  49.     INCLUDE        "exec/memory.i"
  50.     INCLUDE        "exec/ports.i"
  51.     INCLUDE        "exec/libraries.i"
  52.  
  53.     INCLUDE        "../printer/macros.i"
  54.  
  55. *------ Imported Functions -------------------------------------------
  56.  
  57.     XREF_EXE    CloseLibrary
  58.     XREF_EXE    OpenLibrary
  59.     XREF        _AbsExecBase
  60.  
  61.  
  62.     XREF        _PEDData
  63.  
  64.  
  65. *------ Exported Globals ---------------------------------------------
  66.  
  67.     XDEF        _Init
  68.     XDEF        _Expunge
  69.     XDEF        _Open
  70.     XDEF        _Close
  71.     XDEF        _PD
  72.     XDEF        _PED
  73.     XDEF        _SysBase
  74.     XDEF        _DOSBase
  75.     XDEF        _GfxBase
  76.     XDEF        _IntuitionBase
  77.  
  78.  
  79. **********************************************************************
  80.     SECTION        printer,DATA
  81. _PD        DC.L    0
  82. _PED        DC.L    0
  83. _SysBase    DC.L    0
  84. _DOSBase    DC.L    0
  85. _GfxBase    DC.L    0
  86. _IntuitionBase    DC.L    0
  87.  
  88.  
  89. **********************************************************************
  90.     SECTION        printer,CODE
  91. _Init:
  92.         MOVE.L    4(A7),_PD
  93.         LEA    _PEDData(PC),A0
  94.         MOVE.L    A0,_PED
  95.         MOVE.L    A6,-(A7)
  96.         MOVE.L    _AbsExecBase,A6
  97.         MOVE.L    A6,_SysBase
  98.  
  99. *        ;------ open the dos library
  100.         LEA    DLName(PC),A1
  101.         MOVEQ    #0,D0
  102.         CALLEXE OpenLibrary
  103.         MOVE.L    D0,_DOSBase
  104.         BEQ    initDLErr
  105.  
  106.  
  107. *        ;------ open the graphics library
  108.         LEA    GLName(PC),A1
  109.         MOVEQ    #0,D0
  110.         CALLEXE OpenLibrary
  111.         MOVE.L    D0,_GfxBase
  112.         BEQ    initGLErr
  113.  
  114. *        ;------ open the intuition library
  115.         LEA    ILName(PC),A1
  116.         MOVEQ    #0,D0
  117.         CALLEXE OpenLibrary
  118.         MOVE.L    D0,_IntuitionBase
  119.         BEQ    initILErr
  120.  
  121.         MOVEQ    #0,D0
  122. pdiRts:
  123.         MOVE.L    (A7)+,A6
  124.         RTS
  125.  
  126. initPAErr:
  127.         MOVE.L    _IntuitionBase,A1
  128.         LINKEXE    CloseLibrary
  129.  
  130. initILErr:
  131.         MOVE.L    _GfxBase,A1
  132.         LINKEXE    CloseLibrary
  133.  
  134. initGLErr:
  135.         MOVE.L    _DOSBase,A1
  136.         LINKEXE    CloseLibrary
  137.  
  138. initDLErr:
  139.         MOVEQ    #-1,D0
  140.         BRA.S    pdiRts
  141.  
  142. ILName:
  143.         DC.B    'intuition.library'
  144.         DC.B    0
  145. DLName:
  146.         DC.B    'dos.library'
  147.         DC.B    0
  148. GLName:
  149.         DC.B    'graphics.library'
  150.         DC.B    0
  151.         DS.W    0
  152.  
  153.  
  154. *---------------------------------------------------------------------
  155. _Expunge:
  156.         MOVE.L    _IntuitionBase,A1
  157.         LINKEXE    CloseLibrary
  158.  
  159.         MOVE.L    _GfxBase,A1
  160.         LINKEXE    CloseLibrary
  161.  
  162.         MOVE.L    _DOSBase,A1
  163.         LINKEXE    CloseLibrary
  164.  
  165.  
  166. *---------------------------------------------------------------------
  167. _Open:
  168.         MOVEQ    #0,D0
  169.         RTS
  170.  
  171.  
  172.  
  173. *---------------------------------------------------------------------
  174. _Close:
  175.         MOVEQ    #0,D0
  176.         RTS
  177.  
  178.         END
  179.